summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoDRM <[email protected]>2022-09-10 11:42:59 +0200
committerNoDRM <[email protected]>2022-09-10 11:42:59 +0200
commit2d4c5d2c4bd58872e0828d36b584661352bbc531 (patch)
treecc82a905083651191f7b5e4de7617cca44b229f7
parent21281baf21389c7f1c93321c64be0ec3715a0016 (diff)
Fix key import sometimes generating corrupted keys.
Should fix #145, #134, #119, #116, #115, #109 and maybe others.
-rwxr-xr-xDeDRM_plugin/config.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/DeDRM_plugin/config.py b/DeDRM_plugin/config.py
index 193b8f6..79129c3 100755
--- a/DeDRM_plugin/config.py
+++ b/DeDRM_plugin/config.py
@@ -1152,7 +1152,8 @@ class AddAdeptDialog():
zip_function = zip
for key, name in zip_function(defaultkeys, defaultnames):
- if codecs.encode(key,'hex').decode("latin-1") in self.parent.plugin_keys.values():
+ key = codecs.encode(key,'hex').decode("latin-1")
+ if key in self.parent.plugin_keys.values():
print("Found key '{0}' in ADE - already present, skipping.".format(name))
else:
self.new_keys.append(key)
@@ -1167,8 +1168,8 @@ class AddAdeptDialog():
key, name = checkForDeACSMkeys()
if key is not None:
-
- if codecs.encode(key,'hex').decode("latin-1") in self.parent.plugin_keys.values():
+ key = codecs.encode(key,'hex').decode("latin-1")
+ if key in self.parent.plugin_keys.values():
print("Found key '{0}' in DeACSM - already present, skipping.".format(name))
else:
# Found new key, add that.
@@ -1202,7 +1203,7 @@ class AddAdeptDialog():
@property
def key_value(self):
- return codecs.encode(self.new_keys[0],'hex').decode("utf-8")
+ return codecs.encode(self.new_keys[0],'hex').decode("latin-1")
@property